package controller;

import java.io.IOException;

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.amazonaws.auth.BasicAWSCredentials;
import com.amazonaws.services.sqs.AmazonSQS;
import com.amazonaws.services.sqs.AmazonSQSClient;
import com.amazonaws.services.sqs.model.SendMessageRequest;

public class TestAwsServlet extends HttpServlet {
	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws IOException {
		
		AmazonSQS sqs = new AmazonSQSClient( new BasicAWSCredentials("AKIAJO6FMN3TAI53SCHQ", "5d7Oh25MFl9M++0dCXGyBH2+6twGitftZkvYkhv7"));
		String myQueueUrl = "https://queue.amazonaws.com/519221870477/test";
		for (int i = 0; i < 10; i++) {
        	sqs.sendMessage(new SendMessageRequest(myQueueUrl, "This is my message text."+i));
		}
		
	}
}
